package com.sig.tabs;

import com.sig.R;
import com.sig.core.Tab;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;

public class TabHome extends Tab {

	View rootView;
	Button bouton1,bouton2;
	
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View rootView = inflater.inflate(R.layout.tab_home, container, false);

		bouton1 = (Button)rootView.findViewById(R.id.demo_collection_button);
		bouton1.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				Toast.makeText(TabHome.this.getActivity(), "pourquoi tant de haine ?", Toast.LENGTH_SHORT).show();;
			}
		});

		bouton2 = (Button)rootView.findViewById(R.id.demo_external_activity);
		bouton2.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				Intent externalActivityIntent = new Intent(Intent.ACTION_PICK);
				externalActivityIntent.setType("image/*");
				//retour ??? cette activit???
				externalActivityIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
				startActivity(externalActivityIntent);
			}
		});

		return rootView;
	}

	public CharSequence getTitle() {
		return "Launchpad";
	}
}